package com.jonniespratley.codegen.vo
{
	import mx.collections.ArrayCollection;
	
	[Bindable]
	public class OptionsVO
	{
		public var database:String;
		public var host:String;
		public var user:String;
		public var pass:String;
		
		public var application:String = 'Application Title';
		public var copywrite:String = 'This is your applications copywrite header';
		public var framework:String = 'Framework';
		public var namespacee:String = 'com.domain.application';
		public var endpoint:String = 'services/';
		public var path:String = '/PATH/TO/APPLICATION';
		public var tables:Array;
		public var rpc:String;
		public var format:String;
		
		public var serverCodePreview:ArrayCollection;
		public var clientCodePreview:ArrayCollection;
		
		public function OptionsVO(obj:Object = null)
		{
			if (obj != null){
				this.database = obj['database'];
				this.host = obj['host'];
				this.user = obj['user'];
				this.pass = obj['pass'];

				this.application = obj['application'];
				this.copywrite = obj['copywrite'];
				this.framework = obj['framework'];
				this.namespacee = obj['namespace'];
				this.endpoint = obj['endpoint'];
				this.path = obj['path'];
				this.tables = obj['tables'];
				
				this.format = obj['format'];
				this.rpc = obj['rpc'];
			}
		}
	
		public function get label():String{
			return this.application + ' (' + database + ')';
					
		}
	
		public function get children():Array{
			return this.tables
		}
	}
}